Unit Properties
This document outlines all available properties for the Unit class in the Aurora Framework.
Properties
Identification
guid
guid: string
The unique identifier for the unit
unit
unit: string|userdata
WoW unit token or object
id
id: boolean|number
Unit's ID
name
name: string
Unit's name
pointer
pointer: userdata|nil
Unit's memory pointer
creator
creator: guid|nil
Unit's creator
effects
effects: array
Returns a array of current active spell effects and there visual id and location
Health & Status
health
health: number
Current health value
healthmax
healthmax: number
Maximum health value
healthpercent
healthpercent: number
Health percentage (0-100)
hp
hp: number
Alias for health
effectivehp
effectivehp: number;
Effective health points (Taking absorbs and incoming heals into account)
healabsorb
healabsorb: number
Returns the total amount of healing absorption on the unit
stagger
stagger: number
Returns the stagger value of the unit
staggerpct
staggerpct: number
Returns the stagger percentage of the unit from 0 to 100
staggerhealth
staggerhealth: number
Returns the incoming stagger damage of the unit
dead
dead: boolean
Whether the unit is dead
alive
alive: boolean
Whether the unit is alive
exists
exists: boolean
Whether the unit exists
Combat & Threat
combat
combat: boolean
Whether the unit is in combat
threat
threat: number
Unit's threat level
aggro
aggro: boolean
Whether the unit has aggro
aggressive
aggressive: boolean
Whether the unit is aggressive
enemy
enemy: boolean
Whether the unit is an enemy
friend
friend: boolean
Whether the unit is friendly
reaction
reaction: number
Unit's reaction level towards the player
Movement & Position
position
position: Position
Unit's position in 3D space
speed
speed: number
Unit's movement speed
moving
moving: boolean
Whether the unit is moving
movingatall
movingatall: boolean
Whether the unit is moving at all
invehicle
invehicle: boolean
Whether the unit is in a vehicle
standing
standing: boolean
Whether the unit is standing still
height
height: number
Unit's height
combatreach
combatreach: number
Unit's combat reach distance
rotation
rotation: number
Unit's rotation in radians
reach
reach: number
Alias for combatreach
mounted
mounted: boolean
Whether the unit is mounted
timemoving
timemoving: number
Time in seconds the unit has been continuously moving
timestanding
timestanding: number
Time in seconds the unit has been continuously standing still
timecombat
timecombat: number
Time in seconds the unit has been continuously in combat
position
position: Position
Unit's position in 3D space
timeaggro
timeaggro: number
Time in seconds the unit has been aggroed
Unit Type & Classification
class
class: string
Unit's class name (localized)
class2
class2: string
Unit's class name in English
classid
classid: number
Unit's class ID
spec
spec: number
Unit's specialization ID
unitspecid
unitspecid: number
Unit's specialization ID using ObjectSpecializationID function
Aurora.Enums.SpecID Values
Aurora.Enums.SpecID = {
-- Death Knight
BLOOD = 250,
FROST_DK = 251,
UNHOLY = 252,
-- Demon Hunter
HAVOC = 577,
VENGEANCE = 581,
-- Druid
BALANCE = 102,
FERAL = 103,
GUARDIAN = 104,
RESTORATION_DRUID = 105,
-- Hunter
BEASTMASTERY = 253,
MARKSMANSHIP = 254,
SURVIVAL = 255,
-- Mage
ARCANE = 62,
FIRE = 63,
FROST_MAGE = 64,
-- Monk
BREWMASTER = 268,
WINDWALKER = 269,
MISTWEAVER = 270,
-- Paladin
HOLY_PALADIN = 65,
PROTECTION_PALADIN = 66,
RETRIBUTION = 70,
-- Priest
DISCIPLINE = 256,
HOLY_PRIEST = 257,
SHADOW = 258,
-- Rogue
ASSASSINATION = 259,
OUTLAW = 260,
SUBTLETY = 261,
-- Shaman
ELEMENTAL = 262,
ENHANCEMENT = 263,
RESTORATION_SHAMAN = 264,
-- Warlock
AFFLICTION = 265,
DEMONOLOGY = 266,
DESTRUCTION = 267,
-- Warrior
ARMS = 71,
FURY = 72,
PROTECTION_WARRIOR = 73,
-- Evoker
DEVASTATION = 1467,
PRESERVATION = 1468,
AUGMENTATION = 1473,
}
race
race: string
Unit's race name (localized)
race2
race2: string
Unit's race name in English
level
level: number
Unit's level
type
type: number
Unit's type ID
typestring
typestring: string
Unit's type as string
Unit Type Checks
isboss
isboss: boolean
Whether the unit is a boss
ishumanoid
ishumanoid: boolean
Whether the unit is a humanoid
isbeast
isbeast: boolean
Whether the unit is a beast
isundead
isundead: boolean
Whether the unit is undead
isdemon
isdemon: boolean
Whether the unit is a demon
isdragonkin
isdragonkin: boolean
Whether the unit is a dragonkin
iselemenetal
iselemenetal: boolean
Whether the unit is an elemental
isgiant
isgiant: boolean
Whether the unit is a giant
ismechanical
ismechanical: boolean
Whether the unit is mechanical
istotem
istotem: boolean
Whether the unit is a totem
isaberration
isaberration: boolean
Whether the unit is an aberration
isuncategorized
isuncategorized: boolean
Whether the unit is uncategorized
Player-Facing Properties
facing
facing: number
Unit's facing direction in radians
playerfacing
playerfacing: boolean
Whether the player is facing the unit within 90 degrees
playerfacing30
playerfacing30: boolean
Whether the player is facing the unit within 30 degrees
playerfacing45
playerfacing45: boolean
Whether the player is facing the unit within 45 degrees
playerfacing60
playerfacing60: boolean
Whether the player is facing the unit within 60 degrees
playerfacing90
playerfacing90: boolean
Whether the player is facing the unit within 90 degrees
playerfacing180
playerfacing180: boolean
Whether the player is facing the unit within 180 degrees
Unit Counting
enenmiesaround(radius)
enenmiesaround(radius: number): number
Returns the number of enemy units within the specified radius of this unit
friendsaround(radius)
friendsaround(radius: number): number
Returns the number of friendly units within the specified radius of this unit
-- Example: Count friends within 10 yards
local nearbyFriends = unit.friendsaround(10)
friendsaroundhp(distance, hp)
friendsaroundhp(distance: number, hp: number): number
Returns the number of friendly units within the specified distance that are below the specified health percentage
-- Example: Count friends within 20 yards below 50% health
local injuredFriends = player.friendsaroundhp(20, 50)
Group Status
party
party: boolean
Whether the unit is in party
group
group: boolean
Whether the unit is in group
raid
raid: boolean
Whether the unit is in raid
ininstance
ininstance: boolean
Whether the unit is in an instance
inraid
inraid: boolean
Whether the unit is in a raid
Role Properties
role
role: string
Returns the unit's assigned role in group ("TANK", "HEALER", "DAMAGER", or "None")
ishealer
ishealer: boolean
Whether the unit is assigned as a healer
isdps
isdps: boolean
Whether the unit is assigned as a damage dealer
istank
istank: boolean
Whether the unit is assigned as a tank
Visibility & Interaction
visible
visible: boolean
Whether the unit is visible
los
los: boolean
Whether the unit is in line of sight
lootable
lootable: boolean
Whether the unit is lootable
skinnable
skinnable: boolean
Whether the unit is skinnable
tapdenied
tapdenied: boolean
Whether tap is denied for the unit
charmed
charmed: boolean
Whether the unit is charmed
Casting Information
casting
casting: string|false
Current cast name or false
casting1
casting1: string|false
Cast text
casting2
casting2: string|false
Cast texture
castingstart
castingstart: number
Cast start time
castingend
castingend: number
Cast end time
castingtrade
castingtrade: boolean
Whether casting a trade spell
castingid
castingid: string
ID of the spell being cast
castingnotinterruptible
castingnotinterruptible: boolean
Whether the cast cannot be interrupted
castinginterruptible
castinginterruptible: boolean
Whether the cast can be interrupted
castingspellid
castingspellid: number
ID of the spell being cast
castingremains
castingremains: number
Time remaining on the cast
castingpct
castingpct: number
Percentage of cast completed
castingduration
castingduration: number
Time in seconds that the unit has been casting the current spell
casttarget
casttarget: Unit|false
Returns the target of the unit's current cast as a Unit object, or false if no cast target
channeling
channeling: string|false
Current channel name or false
channeling1
channeling1: string|false
Channel text
channeling2
channeling2: string|false
Channel texture
channelingstart
channelingstart: number
Channel start time in seconds
channelingend
channelingend: number
Channel end time in seconds
channelingid
channelingid: string
ID of the channeled spell
channelingnotinterruptible
channelingnotinterruptible: boolean
Whether the channel cannot be interrupted
channelinginterruptible
channelinginterruptible: boolean
Whether the channel can be interrupted
channelingspellid
channelingspellid: number
Spell ID of the channeled spell
channelingremains
channelingremains: number
Percentage of channel time remaining (100 to 0)
channelingpct
channelingpct: number
Percentage of channel completed (100 to 0)
Combat Statistics
ttd
ttd: number
Time to die prediction
Power Types
chargedcp
chargedcp: number
Returns the number of charged combo points for the unit
chargedcompopoints
chargedcompopoints: number
Returns the number of charged combo points for the unit (alias for chargedcp)
Power types and their properties are documented in detail in the Power Types section.
Methods
Unit methods are documented in detail in the Unit Methods section.
Usage Example
-- All property accesses are actually method calls through metatables
local target = Aurora.UnitManager:Get("target")
local player = Aurora.UnitManager:Get("player")
-- Basic target checks
if target.exists and target.enemy and target.alive then
if target.hp < 20 and target.distanceto(player) < 30 then
-- Execute logic here
end
end
-- Example showing type checks and positioning
if target.ishumanoid and not target.ismechanical then
if target.playerfacing then
-- Use frontal cone melee ability on humanoid target
end
end
-- Aura examples
if target.exists then
-- Check for a specific debuff
local hasDeBuff = target.aura(12345)
if hasDeBuff then
local remaining = target.auraremains(12345)
if remaining < 3 then
-- Refresh debuff before it expires
end
end
-- Check aura stacks
local stacks = target.auracount(67890)
if stacks >= 5 then
-- Use ability that consumes stacks
end
-- Check for any aura from a list
local auraList = {12345, 67890, 11223}
if target.aurafrom(auraList) then
-- Unit has at least one of the auras
end
end
-- Combat and casting checks
if target.exists and target.casting then
if target.castinginterruptible and target.castingpct > 50 then
if player.distanceto(target) < 30 then
-- Interrupt the cast
end
end
end
Notes
- Although properties appear to be accessed using dot notation (e.g.,
unit.health
), they are actually method calls through Lua metatables - For clarity in documentation, we show them as properties, but internally they are methods
- All "properties" can be called using either dot notation (
unit.health
) or method notation (unit:health()
) - The
unit
property can accept either a WoW unit token (e.g., "target", "player") or a unit object
Unit References
target
Returns a Unit object representing the unit's current target.
local unit = Aurora.UnitManager:Get("player")
local target = unit.target
if target.exists then
print("My target is " .. target.name)
end
-- Chain targeting
if unit.target.target.exists then
print("My target's target is " .. unit.target.target.name)
end
Unit Characteristics
These properties indicate whether a unit can be affected by various crowd control abilities. In dungeons (party instances), these are determined by the unit's type configuration. Outside of dungeons, all return true by default.
istauntable
istauntable: boolean
Whether the unit can be taunted. In dungeons, this is determined by the unit's taunt configuration.
isgrippable
isgrippable: boolean
Whether the unit can be gripped (Death Grip, etc.). In dungeons, this is determined by the unit's grip configuration.
isfearable
isfearable: boolean
Whether the unit can be feared. In dungeons, this is determined by the unit's fear configuration.
isrootable
isrootable: boolean
Whether the unit can be rooted. In dungeons, this is determined by the unit's root configuration.
issilenceable
issilenceable: boolean
Whether the unit can be silenced. In dungeons, this is determined by the unit's silence configuration.
isslowable
isslowable: boolean
Whether the unit can be slowed. In dungeons, this is determined by the unit's slow configuration.
isstunable
isstunable: boolean
Whether the unit can be stunned. In dungeons, this is determined by the unit's stun configuration.
isincapacitable
isincapacitable: boolean
Whether the unit can be incapacitated. In dungeons, this is determined by the unit's incapacitate configuration.
All these characteristics return true
by default outside of dungeons. Inside dungeons, they check the unit's specific configuration in Aurora.Enums.UnitEnums
.
-- Example: Check if a unit can be controlled before using CC
local target = Aurora.UnitManager:Get("target")
if target.exists and target.enemy then
if target.isstunable then
-- Use stun ability
elseif target.isrootable then
-- Use root ability instead
elseif target.isslowable then
-- Fall back to slow effect
end
end